home *** CD-ROM | disk | FTP | other *** search
- unit Unit2;
-
- interface
-
- uses
- SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
- Forms, Dialogs, StdCtrls, Buttons, ExtCtrls;
-
- type
- TViewerForm = class(TForm)
- Panel1: TPanel;
- FontButton: TSpeedButton;
- FontDialog1: TFontDialog;
- PrintButton: TSpeedButton;
- PrintDialog1: TPrintDialog;
- Memo1: TMemo;
- procedure FontButtonClick(Sender: TObject);
- procedure PrintButtonClick(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
-
- var
- ViewerForm: TViewerForm;
-
- implementation
- Uses UnitPerf, Printers;
-
- {$R *.DFM}
-
- procedure TViewerForm.FontButtonClick(Sender: TObject);
- begin
- if FontDialog1.Execute then Memo1.Font := FontDialog1.Font
- end;
-
- procedure TViewerForm.PrintButtonClick(Sender: TObject);
- var PrintFile: System.Text;
- i: Integer;
- begin
- if PrintDialog1.Execute then
- begin
- AssignPrn(PrintFile);
- Rewrite(PrintFile);
- for i:=0 to Memo1.Lines.Count-1 do writeln(PrintFile,Memo1.Lines[i]);
- System.Close(PrintFile)
- end
- end;
-
- end.
-
-